<?php
class Cache 
{
	private $db;
	
	function __construct() {
		$this->db = godhouse::app()->db;
	}
	
	public function flush($type='') {
		$modules = array('template');
		if(in_array($type, $modules)) {
			$action = 'flush_'.$type;
			$this->$action();
		}
	}
	
	private function flush_template() {
		$templatePath = GODHOUSE_ROOT.'data/compile/';
		if(is_dir($templatePath)) {
			removeFile($templatePath);
		        return true;
		} else {
			return false;
		}
	}
}